package com.tulele.vtool.service.impl;

import com.tulele.vtool.mapper.UserShareArticleInfoMapper;
import com.tulele.vtool.model.UserShareArticleInfo;
import com.tulele.vtool.service.IUserShareArticleInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserShareArticleInfoServiceImpl implements IUserShareArticleInfoService {

    @Autowired
    private UserShareArticleInfoMapper userShareArticleInfoMapper;

    @Override
    public int recordUserShareArticleInfo(UserShareArticleInfo userShareArticleInfo) {
        return userShareArticleInfoMapper.addUserShareArticleInfo(userShareArticleInfo);
    }

    @Override
    public int deleteByUserIdAndArticleId(Integer userId, Integer articleId) {
        return userShareArticleInfoMapper.deleteByUserIdAndArticleId(userId, articleId);
    }

    @Override
    public Integer getUserSharedArticleCount(Integer userId) {
        return userShareArticleInfoMapper.getUserSharedArticleCount(userId);
    }
}
